#include <iostream>
#include <algorithm>

using namespace std;

int main(int argc, char const *argv[])
{
    int n, i, j, map[64][64] = {}, last_x, last_y;
    cin >> n;
    last_x = 1;
    last_y = n / 2 + 1;
    map[last_x][last_y] = 1;
    for (i = 2; i <= n * n; i++)
    {
        if (last_x == 1 && last_y != n)
        {
            last_x = n;
            last_y++;
            map[last_x][last_y] = i;
        }
        else if (last_x != 1 && last_y == n)
        {
            last_x--;
            last_y = 1;
            map[last_x][last_y] = i;
        }
        else if (last_x == 1 && last_y == n)
        {
            last_x++;
            map[last_x][last_y] = i;
        }
        else if (map[last_x - 1][last_y + 1] == 0)
        {
            last_x--;
            last_y++;
            map[last_x][last_y] = i;
        }
        else
        {
            last_x++;
            map[last_x][last_y] = i;
        }
    }
    for (i = 1; i <= n; i++)
    {
        if (i != 1)
        {
            cout << endl;
        }
        
        for (j = 1; j <= n; j++)
        {
            cout << map[i][j] << " ";
        }
    }
    
    return 0;
}
